function getHeadings(csv) {
  const headings = csv.split(',');
  for (let i=0; i<headings.length; i++) {
    headings[i] = headings[i].trim();
  }
  return headings;
}


let output = getHeadings(" name,age , city ");
console.log(output);